﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;

namespace K3R.Data {
	public static class Extension {
		// Generic
		public static T DBValueOrDefault<T>(object item, T defValue) {
			return (item != DBNull.Value ? (T)item : defValue);
		}

		public static T DBValueOrDefault<T>(SqlParameter item, T defValue) {
			return (item.Value != DBNull.Value ? (T)item.Value : defValue);
		}
	}
}
